<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<LINK rel=stylesheet type=text/css href="../css/style.css">
<script type="text/javascript" src="../scripts/jquery-1.8.3.js"></script>
<script type="text/javascript">
	$(function() {
		$("#regsName").blur(function(){
			$.post("users.do",{'name':$("#regsName").val()},function(data){
  				if(data == "true"){
  					$("#regsError").html("用户名已存在！");
  				}else{
  					$("#regsError").html("");
  				}
  			});
		});
		$("#regValidation").click(function() {
			var name = $("input[name=name]").val();
			var password = $("input[name=password]").val();
			var repassword = $("input[name=repassword]").val();
			var regsError = $("#regsError").html();
			if (name == "" || password == "" || repassword == "") {
				alert("信息不完整！");
				return false;
			} else if (password != repassword) {
				alert("输入的密码不一致！");
				return false;
			}
			if(regsError == "用户名已存在！"){
				alert("用户名已存在！");
				return false;
			}
			$("#regsSubmit").submit();
		});
	});
</script>
<title>青鸟租房 - 用户注册</title>
</head>

<body>
	<DIV id=header class=wrap>
		<DIV id=logo>
			<IMG src="../images/logo.gif">
		</DIV>
	</DIV>
	<DIV id=regLogin class=wrap>
		<DIV class=dialog>
			<DL class=clearfix>
				<DT>新用户注册</DT>
				<DD class=past>填写个人信息</DD>
			</DL>
			<DIV class=box>
				<div id="regsError" style="color: red;position: absolute;left: 45%;top: 28%;"></div>
				<FORM action="regs.do" method=post id=regsSubmit>
					<DIV class=infos>
						<TABLE class=field>
							<TBODY>
								<TR>
									<TD class=field>用 户 名：</TD>
									<TD><INPUT class=text type=text name=name id="regsName"></TD>
								</TR>
								<TR>
									<TD class=field>密 码：</TD>
									<TD><INPUT class=text type=password name=password>
									</TD>
								</TR>
								<TR>
									<TD class=field>确认密码：</TD>
									<TD><INPUT class=text type=password name=repassword>
									</TD>
								</TR>
								<TR>
									<TD class=field>电 话：</TD>
									<TD><INPUT class=text type=text name=telephone></TD>
								</TR>
								<TR>
									<TD class=field>用户姓名：</TD>
									<TD><INPUT class=text type=text name=username></TD>
								</TR>
							</TBODY>
						</TABLE>
						<DIV class=buttons>
							<INPUT value=立即注册 type=submit id=regValidation>
						</DIV>
					</DIV>
				</FORM>
			</DIV>
		</DIV>
	</DIV>
	<DIV id=footer class=wrap>
		<DL>
			<DT>青鸟租房 © 2010 北大青鸟 京ICP证1000001号</DT>
			<DD>关于我们 · 联系方式 · 意见反馈 · 帮助中心</DD>
		</DL>
	</DIV>
</BODY>
</HTML>

